/*
 * @Description: 新增的月份列表账单页面Demo
 * @Author: yingying.fan
 * @Date: 2019-04-09 16:54:44
 * @Last Modified by: zhenqiang.hong
 * @Last Modified time: 2019-05-07 13:22:26
 */
<script>
import BaseMonthList from '@/components/scroll/BaseMonthList'
import BusConsumeItem from '../components/consumemodule/BusConsumeItem'
import WalletConsumeItem from '../components/consumemodule/WalletConsumeItem'
// import * as TradeType from '../../consumedetail/constants/TradeType.js'
// import { getConsumeList } from '../api/api.js'
export default {
  extends: BaseMonthList,
  components: {
    'bus-consume-item': BusConsumeItem,
    'wallet-consume-item': WalletConsumeItem
  },
  data() {
    return {
      useBody: true,
      noDataText: '暂无内容',
      up: {
        noMoreSize: 11,
        page: { size: 10 }
      }
      // getListByAjax: getConsumeList
    }
  },
  mounted() {
    // 添加返回事件回调刷新账单列表
    document.addEventListener(
      'resume',
      () => {
        this.getListRefresh()
      },
      false
    )
  },
  methods: {
    getDetailList(item) {
      return item.TRADE_DETAILS
    },
    // 根据消费类型动态获取消费模块组件
    getItemComponent(item) {
      let type = item.TRADE_SCENE
      let itemName = ''
      switch (type) {
        case 1:
        case 2:
          itemName = 'wallet-consume-item'
          break
        case 3:
        case 4:
          itemName = 'bus-consume-item'
          break
      }
      return itemName
    }
  }
}
</script>
